<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>用户列表</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet" href="/css/style.css">
    <style>
        body {
            padding: 20px;
        }

        table {
            width: 100%;
        }

        table th, table td {
            vertical-align: middle;
        }

        .btn {
            margin: 5px;
        }
    </style>
</head>
<body>

<div class="container">
    <h1 class="mb-4">用户列表</h1>
    <a href="/user/create" class="btn btn-primary mb-3">新增用户</a>

    <table class="table table-striped table-bordered">
        <thead class="table-dark">
        <tr>
            <th>用户名</th>
            <th>角色</th>
            <th>创建时间</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>
        <tr th:each="user : ${users}">
            <td th:text="${user.username}"></td>
            <td th:text="${user.role}"></td>
            <td th:text="${user.createdAt}"></td>
            <td>
                <a href="/user/edit/{user.id}" class="btn btn-warning">编辑</a>
                <a href="/user/delete/{user.id}" class="btn btn-danger">删除</a>
            </td>
        </tr>
        </tbody>
    </table>
</div>

<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>
